﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Upeu.Facturacion.Data.Entities;

namespace Upeu.Facturacion.Data.Mappings
{
    public class ClienteMap : EntityTypeConfiguration<Cliente>
    {
        public ClienteMap()
        {
            //cambiar nombre table
            ToTable("Clientes");

            //pk
            HasKey(t => t.Id);
            Property(t => t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            //campos
            Property(t => t.Ruc).IsOptional();
            Property(t => t.Direccion).IsOptional();
            Property(t => t.Nombre).IsRequired();
        }
    }
}
